/*
 * @Author: xiaosihan 
 * @Date: 2022-08-20 17:08:13 
 * @Last Modified by: xiaosihan
 * @Last Modified time: 2025-08-23 14:32:17
 */
import hashHistory from '@/srcWeb/hashHistory';
import loadable from "@loadable/component";
import ReactDOM from 'react-dom/client';
import { Route, unstable_HistoryRouter as Router, Routes } from 'react-router-dom';
import './index.css';

import { configure } from "mobx";
import Home from '@/srcWeb/pages/Home/Home';
import PageLayout from './components/PageLayer/PageLayout';
// mobx 配置，不强制执行动作
configure({ enforceActions: "never" });

const Ui = loadable(() => import("./pages/Ui/Ui"));
const Home2 = loadable(() => import("./pages/Home2/Home2"));
const CannonDemo = loadable(() => import('./pages/CannonDemo/CannonDemo'));
// 添加新页面懒加载
const FabricDemo = loadable(() => import('./pages/FabricDemo/FabricDemo'));
const OllamaTest = loadable(() => import('./pages/ollamaTest/ollamaTest'));
const Web3Demo = loadable(() => import('./pages/Web3Demo/Web3Demo'));
// 添加MySQL事件管理页面懒加载
const MySqlEventManager = loadable(() => import('./pages/MySqlEventManager/MySqlEventManager'));
// 添加数据查看器页面懒加载
const DataViewer = loadable(() => import('./pages/DataViewer/DataViewer'));
const MyImg = loadable(() => import('./pages/MyImg/MyImg'));
const CadConversion = loadable(() => import('./pages/CadConversion/CadConversion'));

const Render3DGoods = loadable(() => import('./pages/Render3DGoods/Render3DGoods'));
// 添加大屏页面懒加载
const LargeScreen = loadable(() => import('./pages/LargeScreen/LargeScreen'));



const Root = ReactDOM.createRoot(document.getElementById('root')!);

Root.render(
    <Router
        history={hashHistory}
        future={{
            v7_startTransition: true,
            v7_relativeSplatPath: true
        }}
    >
        <PageLayout>
            <Routes>
                <Route path="/" element={<Home />} />
                <Route path="/ui" element={<Ui />} />
                <Route path="/home2" element={<Home2 />} />
                <Route path="/cannonDemo" element={<CannonDemo />} />
                <Route path="/fabricDemo" element={<FabricDemo />} />
                {/* 添加ollamaTest页面的路由 */}
                <Route path="/ollamaTest" element={<OllamaTest />} />
                {/* 添加web3Demo页面的路由 */}
                <Route path="/web3Demo" element={<Web3Demo />} />
                {/* 添加MySQL事件管理页面的路由 */}
                <Route path="/mysqlEventManager" element={<MySqlEventManager />} />
                {/* 添加数据查看器页面的路由 */}
                <Route path="/dataViewer" element={<DataViewer />} />
                {/* 添加我的图片页面的路由 */}
                <Route path="/myImg" element={<MyImg />} />
                {/* 添加CAD转换页面的路由 */}
                <Route path="/cadConversion" element={<CadConversion />} />
                {/* 添加3D商品渲染页面的路由 */}
                <Route path="/render3DGoods" element={<Render3DGoods />} />
                {/* 添加大屏页面的路由 */}
                <Route path="/largeScreen" element={<LargeScreen />} />
            </Routes>
        </PageLayout>
    </Router>
);

//@ts-ignore
console.log("前端发版时间", process.env.BUILD_TIME);
console.log("程序问题反馈联系方式 %cqq389652405", 'color: red');